package com.sc.nft.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.UserInfo;
import com.sc.nft.entity.UserPledgeCollectionRecords;
import com.sc.nft.entity.vo.*;
import com.sc.nft.enums.PledgeStatusEnum;
import com.sc.nft.enums.RewardStatusEnum;
import com.sc.nft.enums.UserMerchantPledgeTaskStatusEnum;

import java.util.List;

/**
 * 质押任务-用户质押记录服务接口
 *
 * @author Sun
 * @since 2023-06-12 15:37:52
 * @description 由 Mybatisplus Code Generator 创建
 */
public interface UserPledgeCollectionRecordsService {


    /**
     * 管理后台-分页查询质押记录
     * @param userTel
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<AdminPagePledgeRecordsRecordVO> adminPagePledgeRecordsRecord(Long pledgeTaskId,String userTel,Integer pageNo, Integer pageSize);

    /**
     * 根据用户id和质押任务id查询质押记录
     * @param userId
     * @param pledgeTaskId
     * @param pledgeStatus
     * @return
     */
    Integer getCountByUserIdAndPledgeTaskIdAndStatus(Long userId, Long pledgeTaskId, PledgeStatusEnum pledgeStatus);
    /**
     * 根据用户id和质押任务id和质押藏品id查询质押记录
     * @param userId
     * @param pledgeTaskId
     * @param pledgeStatus
     * @return
     */
    Integer getCountByUserIdAndPledgeTaskIdAndCollectionIdAndStatus(Long userId, Long pledgeTaskId,Long pledgeTaskCollectionId, PledgeStatusEnum pledgeStatus);

    /**
     * 分页获取用户质押记录
     * @param user
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<PledgeSecretAreaPageVO> pledgeSecretAreaPage(UserInfo user, Long pledgeTaskId,Integer pageNo, Integer pageSize);

    /**
     * 用户质押记录详情
     * @param user
     * @param pledgeTaskId
     * @param userPledgeRecordsId
     * @return
     */
    PledgeSecretAreaDetailsVO pledgeSecretAreaDetails(UserInfo user, Long pledgeTaskId, Long userPledgeRecordsId);

    /**
     * 更新奖励状态
     * @param id
     * @param rewardStatus
     * @return
     */
    Boolean updateRewardStatusById(Long id, RewardStatusEnum rewardStatus);
    /**
     * 更新质押状态和奖励状态
     * @param id
     * @param rewardStatus
     * @return
     */
    Boolean updatePledgeStatusAndRewardStatusById(Long id,PledgeStatusEnum nowStatus, PledgeStatusEnum pledgeStatus, RewardStatusEnum rewardStatus);

    /**
     * 根据用户id和质押记录id和质押状态查询质押记录
     * @param userId
     * @param userPledgeRecordsId
     * @param pledgeStatusEnum
     * @return
     */
    List<UserPledgeCollectionRecords> getListByUserIdAndUserPledgeRecordsIdAndPledgeStatus(Long userId, Long userPledgeRecordsId, PledgeStatusEnum pledgeStatusEnum);

    /**
     * 修改用户质押明细表状态
     * @param userPledgeRecordsId
     * @param pledgeStatusEnum
     * @return
     */
    Boolean updatePledgeStatusByUserPledgeRecordsId(Long userPledgeRecordsId, PledgeStatusEnum pledgeStatusEnum);

    /**
     * 根据用户id和质押任务id查询质押记录
     * @param userId
     * @param pledgeTaskId
     * @param pledgeTaskCollectionId
     * @param pledgeStatus
     * @return
     */
    Integer getCountByUserIdAndPledgeTaskIdAndPledgeTaskCollectionIdAndStatus(Long userId, Long pledgeTaskId, Long pledgeTaskCollectionId, PledgeStatusEnum pledgeStatus);

    /**
     * 修改用户质押明细表状态
     * @param id
     * @return
     */
    Boolean updateSuccessForPledgeStatusById(Long id);
}
